<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>动态添加和删除节点</title>
		<style type="text/css">
			.myArea{ width: 100%; height: 80px;}
			.myDiv{ line-height: 30px;}
		</style>
		<script>
            // ======代码=======
			function RemoveRow() {
            var OldDiv=document.getElementById('div')
            var DelDiv=document.getElementById('div'+DelNum)
            if (DelDiv) {
                DelNum++
                OldDiv.removeChild(DelDiv)
            }

        }
		function AddRow(){
			var Div=document.getElementById('myContainer')

			var h1=document.createElement('h1')
			var h2=document.createElement('h2')
			var h3=document.createElement('h3')
			
			var txt1=document.createTextNode(Div.children[0].children[0])
			var txt2=document.createTextNode(Div.children[0].children[1])
			var txt3=document.createTextNode(Div.children[0].children[4])

			h1.append(txt1)
			h2.append(txt2)
			
		}
		
		
		
		
		
		
        </script>
	</head>
	<body>
		<h2>工作经历</h2>
		<hr/>
		<div id="myContainer">
			<div class="myDiv" id="div1">
				公司名称:<input type="text" />
				职位:<input type="text" />
				<a href="javascript:RemoveRow('div1')">删除工作经历</a>
				<br />
				工作职责及工作内容描述:
				<textarea class="myArea"></textarea>
				<hr />
			</div>			
		</div>
		
		<div style="line-height: 30px; text-align: right;">
			<a href="javascript:AddRow();">添加工作经历</a>
		</div>

	</body>
</html>